﻿@model ETL.Business.Models.ProjectTaskModel

<script src="../../Scripts/managetask-events.js" type="text/javascript"></script>
<script src="../../Scripts/managetask-functions.js" type="text/javascript"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $('#ddlUsers').chosen();
        $('#inputStartDate').datepicker();
        $('#inputStartTime').timepicker();

        $('#inputEndDate').datepicker();
        $('#inputEndTime').timepicker();
    })
</script>

<div id="editTaskDiv" class="span4">
        <fieldset>
        <legend>Edit task</legend>   

        <div class="row">
            <div class="span4">Task name</div>
            <div class="span4">
                <input type="text" id="txtTaskName" value='@Model.TaskName'/>
                <input type="hidden" id="txtTaskId" value='@Model.TaskId'/>
            </div>
        </div>
        <div class="row">
            <div class="span4">Assigned users</div>
            <div class="span4">
                <select id="ddlUsers" style="width: 100%;" multiple data-placeholder="Select users...">
                            @if (Model.AssignedUsers != null && Model.AssignedUsers.Count() > 0)
                            {
                                foreach (var user in Model.AssignedUsers)
                                {
                                  <option value='@user.Id' selected>@user.FullName</option>
                                }
                            }
                            @if (Model.UnassignedUsers != null && Model.UnassignedUsers.Count() > 0)
                            {
                                foreach (var user in Model.UnassignedUsers)
                                {
                                  <option value='@user.Id'>@user.FullName</option>
                                }
                            }
                    </select>
            </div>
        </div>
        <br />

        <div class="row">
            <div class="span4">Start date</div>
            <div class="span4">
                <input id="inputStartDate" name="inputStartDate" type="text" class="datepicker" size="16" value="@Model.DisplayStartDate"/>
                <input id="inputStartTime" name="inputStartTime" type="text" class="timepicker" size="16" value="@Model.DisplayStartTime"/>
            </div>
        </div>

        <div class="row">
            <div class="span4">End date</div>
            <div class="span4">
                <input id="inputEndDate" name="inputEndDate" type="text" class="datepicker" size="16" value="@Model.DisplayEndDate"/>
                <input id="inputEndTime" name="inputEndTime" type="text" class="timepicker" size="16" value="@Model.DisplayEndTime"/>
            </div>
        </div>
        <div class="row">
            <div class="span2"><a class="btn actButtons btn-primary" id="btnSaveTask">Save</a></div>
            <div class="span2" style="margin-left : 5px">
            <a class="btn actButtons btn-warning" id="btnDeleteTask">Delete</a>
            </div>
        </div>


        </fieldset>
    </div>